# encoding=utf-8
from house.models import *
from django.shortcuts import render_to_response 
from django.template import RequestContext

def index(request,template_name):
    house_list=House.objects.all().reverse()[:8] 
    return render_to_response(template_name,locals(),context_instance=RequestContext(request))

def house_list (request,template_name):
    house_list=House.objects.all()
    return render_to_response(template_name,locals(),context_instance=RequestContext(request))

def rent_list (request,template_name):
    return render_to_response(template_name,locals(),context_instance=RequestContext(request))

def contact_view (request,template_name):
    return render_to_response(template_name,context_instance=RequestContext(request))
    
def detail (request,id,template_name):
    house=House.objects.get(id=id)
    return render_to_response(template_name,locals(),context_instance=RequestContext(request))
